package com.hisense.hiioc.hismartplate.robot.message;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @Auther:biexiande@hisense.com
 * @date:2018/12/17 16:00
 * @des
 */
@Data
@AllArgsConstructor
public class RobotResponse {
    private String domain ;
    private boolean isEnd ;
    private String scene;
    private String intent;
    private String param1;
    private String param2;
    private String response;

    public static RobotResponse buildResponse(String aimlResponse){
        String[] aimlArray  =  aimlResponse.split("%",-1);
        String scene = aimlArray[0]+aimlArray[2];
        return new RobotResponse(aimlArray[0],Boolean.parseBoolean(aimlArray[1]),scene,aimlArray[2],aimlArray[3],aimlArray[4],aimlArray[5]);
    }

}